package com.cloud.mall.pms.service;

import com.cloud.mall.api.CommonPage;
import com.cloud.mall.base.BaseResponse;
import com.cloud.mall.pms.dto.PmsBrandParam;
import com.cloud.mall.pms.out.PmsBrandOut;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@Api(tags = "商品品牌管理")
@RequestMapping("/brand")
public interface PmsBrandService {

    @ApiOperation("添加品牌")
    @PostMapping("/create")
    BaseResponse create(@RequestBody PmsBrandParam pmsBrandParam);

    @ApiOperation("删除品牌")
    @PostMapping("/delete/{id}")
    BaseResponse delete(@PathVariable("id") Long id);

    @ApiOperation("更新品牌")
    @PostMapping("/update/{id}")
    BaseResponse update(@PathVariable("id") Long id,@RequestBody PmsBrandParam pmsBrandParam);

    @ApiOperation(value = "获取全部品牌列表")
    @GetMapping("/listAll")
    BaseResponse<List<PmsBrandOut>> getList();


    @ApiOperation(value = "根据品牌名称分页获取品牌列表")
    @GetMapping("/list")
    BaseResponse<CommonPage<PmsBrandOut>> getList(@RequestParam(value = "keyword", required = false) String keyword,
                                                      @RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum,
                                                      @RequestParam(value = "pageSize", defaultValue = "5") Integer pageSize);
    @ApiOperation(value = "根据编号查询品牌信息")
    @GetMapping("/{id}")
    BaseResponse<PmsBrandOut> getItem(@PathVariable("id") Long id);

    @ApiOperation(value = "批量删除品牌")
    @PostMapping("/delete/batch")
    BaseResponse deleteBatch(@RequestParam("ids") List<Long> ids);

    @ApiOperation(value = "批量更新显示状态")
    @PostMapping("/update/showStatus")
    BaseResponse updateShowStatus(@RequestParam("ids") List<Long> ids,
                                         @RequestParam("showStatus") Integer showStatus);

    @ApiOperation(value = "批量更新厂家制造商状态")
    @PostMapping("/update/factoryStatus")
    BaseResponse updateFactoryStatus(@RequestParam("ids") List<Long> ids,
                                            @RequestParam("factoryStatus") Integer factoryStatus);

}
